<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/jquery-3.6.0.min.js"></script>
    <style>
        botton:hover{
            background-color: #c7c6c6;
        }
        /*div{*/
        /*    background-color: white;*/
        /*    position: relative;*/
        /*}*/
        button{
            background-color: white;
        }

    </style>
    <script>
       $(function (){
           //需求：给按钮们添加事件：设置body的背景色
           //获取到按钮们
           let deng=document.getElementsByTagName("botton");
           // console.log(deng);
           //给开灯按钮设置点击事件
           deng[0].onclick=function (){
               $('body').css('backgroundColor','white');
           }
            //给关灯按钮设置点击事件
           // let $guan=$(deng[1]);
           // $guan.click()
           $(deng[1]).click(function (){
               $('body')[0].style.backgroundColor="black";
           })
       });
    </script>
</head>
<body>
 <div>
     <botton>开灯</botton>
     <botton>关灯</botton>
 </div>
 <img src="./201303.jpg" alt="">
</body>
</html>